import request from "@/api/request";
// 获取全部容器列表
export function containerAllList() {
    return request({
        url: '/container/all',
        method: 'get'
    })
}
// 按服务器获取容器
export function containerList(server_id) {
    return request({
        url: '/container/list/',
        method: 'get',
        params: {
            server_id:server_id
        }
    })
}
// 获取正在运行的容器的性能指标
export function runningContainerList(server_id) {
    return request({
        url: '/container/perf/all',
        method: 'get',
        params: {
            server_id
        }
    })
}
// 获取单个容器实时性能指标
export function oneContainerRealPerf(container_id) {
    return request({
        url: '/container/perf/get',
        method: 'get',
        params: {container_id}
    })
}
// 单个容器CPU使用率历史数据
export function oneContainerCpuHistoryPerf(container_id, start_time, end_time, period) {
    return request({
        url: '/container/perf/cputime',
        method: 'get',
        params: {
            container_id,
            start_time,
            end_time,
            period
        }
    })
}
// 单个容器GPU使用率历史数据
export function oneContainerGpuHistoryPerf(container_id, start_time, end_time, period) {
    return request({
        url: '/container/perf/gputime',
        method: 'get',
        params: {
            container_id,
            start_time,
            end_time,
            period
        }
    })
}
// 单个容器内存使用率历史数据
export function oneContainerRamHistoryPerf(container_id, start_time, end_time, period) {
    return request({
        url: '/container/perf/ramtime',
        method: 'get',
        params: {
            container_id,
            start_time,
            end_time,
            period
        }
    })
}
// 获取容器启动时长测试列表
export function containerStartTime() {
    return request({
        url: '/container/start/all',
        method: 'get'
    })
}
// 获取具体某个容器的启动时长
export function oneContainerStartTime(container_id) {
    return request({
        url: '/container/start/container',
        method: 'get',
        params:{
            container_id
        }
    })
}
// 按服务器筛选容器启动时长
export function serverContainerStartTime(server_id) {
    return request({
        url: '/container/start/server',
        method: 'get',
        params:{
            server_id
        }
    })
}
// 单个容器启动时长
export function singleContainerStartTime(container_id) {
    return request({
        url: '/container/start/test',
        method: 'get',
        params:{
            container_id
        }
    })
}
// 集群启动时长
export function clusterContainerStartTime(container_list) {
    return request({
        url: '/container/cluster/test',
        method: 'get',
        params:{
            container_list
        }
    })
}
// 获取集群启动全部测试列表
export function clusterContainerStartList() {
    return request({
        url: '/container/cluster/all',
        method: 'get'
    })
}
// 按服务器筛选集群启动时长测试列表
export function serverClusterContainerStartList(server_id) {
    return request({
        url: '/container/cluster/server',
        method: 'get',
        params:{
            server_id
        }
    })
}
// 按服务器筛选集群启动时长测试列表
export function sizeClusterContainerStartList(size) {
    return request({
        url: '/container/cluster/size',
        method: 'get',
        params:{
            size
        }
    })
}
// 场景新增
export function addScene(data) {
    return request({
        url: '/container/scene/add',
        method: 'post',
        data
    })
}
// 场景修改
export function editScene(data) {
    return request({
        url: '/container/scene/edit',
        method: 'post',
        data
    })
}
// 场景列表
export function sceneList() {
    return request({
        url: '/container/scene/all',
        method: 'get'
    })
}
// 场景删除
export function delScene(scene_id) {
    return request({
        url: '/container/scene/delete',
        method: 'get',
        params:{
            scene_id
        }
    })
}
// 场景启动
export function startScene(scene_id) {
    return request({
        url: '/container/scene/start',
        method: 'get',
        params:{
            scene_id
        }
    })
}
// 场景关闭
export function endScene(scene_id) {
    return request({
        url: '/container/scene/stop',
        method: 'get',
        params:{
            scene_id
        }
    })
}
// 只启动选定的多个容器
export function startMultiContainer(container_list) {
    return request({
        url: '/container/starts/',
        method: 'get',
        params:{
            container_list
        }
    })
}
// 启动单个容器
export function startSingleContainer(container_list) {
    return request({
        url: '/container/start/',
        method: 'get',
        params:{
            container_list
        }
    })
}
// 获取场景启动情况列表
export function sceneStartDetails(scene_id) {
    return request({
        url: '/container/scenestart/all',
        method: 'get',
        params:{
            scene_id
        }
    })
}
// 获取时间段的详情
export function sceneStartTime(scene_id,number) {
    return request({
        url: '/container/scenestart/time',
        method: 'get',
        params:{
            scene_id,
            number
        }
    })
}
export function sceneStartTimeDetails(scene_id,number) {
    return request({
        url: '/container/scenestart/detail',
        method: 'get',
        params:{
            scene_id,
            number
        }
    })
}
// cloudPhoneManager 容器总览信息
export function containerPerfTotal(server_id) {
    return request({
        url: '/container/perf/total',
        method: 'get',
        params: {
            server_id
        }
    })
}
// cloudPhoneBaseInfo app启动时长
export function containerAppData(server_id) {
    return request({
        url: '/container/app/server',
        method: 'get',
        params: {
            server_id
        }
    })
}

// cloudPhoneBaseInfo 容器APP启动
export function containerAppStart(apk_name, container_id) {
    return request({
        url: '/container/app/test',
        method: 'get',
        params: {
            app_id :apk_name,
            container_id
        }
    })
}
// app列表
export function appList() {
    return request({
        url: '/container/app',
        method: 'get'
    })
}
// state筛选列表
export function stateList(container_state) {
    return request({
        url: '/container/state',
        method: 'get',
        params: {
            container_state
        }
    })
}
